package com.smfx.yxt.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smfx.yxt.daoSqlserver.TeacherSignUpMapper;
import com.smfx.yxt.model.TeacherSignUp;
import com.smfx.yxt.page.Page;
import com.smfx.yxt.service.ITeacherSignUpService;

@Service("teacherSignUpService")
public class TeacherSignUpServiceImpl implements ITeacherSignUpService {

	@Autowired
	private TeacherSignUpMapper teacherSignUpMapper;
	
	@Override
	public int addAndUpdate(TeacherSignUp record) {
		if(record.getId() == null) {
			return teacherSignUpMapper.insertSelective(record);
		}
		record.setUpdateTime(new Date());
		return teacherSignUpMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public TeacherSignUp selectByPrimaryKey(Integer id) {
		return teacherSignUpMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<TeacherSignUp> selectListByPage(Page<TeacherSignUp> page) {
		return teacherSignUpMapper.selectListByPage(page);
	}

}
